package com.moleq.models;

import com.moleq.enums.PaymentType;
import com.moleq.util.MoleQUtil;

public class PosTender {
	
	
//	private int entryNo;
	public PaymentType paymentType;
	public double afterRoundingValue = 0;
	public int poslineTenderNo;
	public boolean isNeedPrint;
	
//	public String AuthCode = "";
//	public String CardType = "";
//	public String CardNo = "";
	
	public boolean isNeedPrint() {
		return isNeedPrint;
	}

	public void setNeedPrint(boolean isNeedPrint) {
		this.isNeedPrint = isNeedPrint;
	}

	public int getPoslineTenderNo() {
		return poslineTenderNo;
	}

	public void setPoslineTenderNo(int poslineTenderNo) {
		this.poslineTenderNo = poslineTenderNo;
	}

	public PosTender(){}
	
	public PosTender(int pt_store_id, int pt_station,
			String pt_date, int pt_seq_no, String pt_online, int pt_function,
			double pt_due, double pt_tender, double pt_change,
			String pt_ref_no, String pt_auth_chk,String pt_card_type,String pt_card_no,String pt_Auth,String HostCode,int pt_trn_no) {
//		this.pt_id = pt_id;
		this.pt_store_id = pt_store_id;
		this.pt_station = pt_station;
		this.pt_date = pt_date;
		this.pt_seq_no = pt_seq_no;
		this.pt_online = pt_online;
		this.pt_function = pt_function;
		this.pt_due = pt_due;
		this.pt_tender = pt_tender;
		this.pt_change = pt_change;
		this.pt_ref_no = pt_ref_no;
		this.pt_auth_chk = pt_auth_chk;
		this.pt_card_type = pt_card_type;
		this.pt_card_no = pt_card_no;
		this.pt_Auth = pt_Auth;
		this.HostCode = HostCode;
		this.pt_trn_no = pt_trn_no;
		this.paymentType = getPaymentType(pt_function);
	}
	
	public PosTender(int pt_id,int pt_store_id, int pt_station,
			String pt_date, int pt_seq_no, String pt_online, int pt_function,
			double pt_due, double pt_tender, double pt_change,
			String pt_ref_no, String pt_auth_chk,String pt_card_type,String pt_card_no,String pt_Auth,String HostCode,PaymentType paymentType,int pt_trn_no) {
		this.pt_id = pt_id;
		this.pt_store_id = pt_store_id;
		this.pt_station = pt_station;
		this.pt_date = pt_date;
		this.pt_seq_no = pt_seq_no;
		this.pt_online = pt_online;
		this.pt_function = pt_function;
		this.pt_due = pt_due;
		this.pt_tender = pt_tender;
		this.pt_change = pt_change;
		this.pt_ref_no = pt_ref_no;
		this.pt_auth_chk = pt_auth_chk;
		this.pt_card_type = pt_card_type;
		this.pt_card_no = pt_card_no;
		this.pt_Auth = pt_Auth;
		this.HostCode = HostCode;
		this.paymentType = paymentType;
		this.pt_trn_no = pt_trn_no;
	}
	
	private int pt_id; 
	private int pt_store_id; 
	private int pt_station; 
	private String pt_date=""; 
	private int pt_seq_no;
	private String pt_online=""; 
	private int pt_function; 
	private double pt_due; 
	private double pt_tender; 
	private double pt_change; 
	private String pt_ref_no=""; 
	private String pt_auth_chk="";
	private String pt_card_type="";
	private String pt_card_no ="";
	private String pt_Auth = "";
	public String HostCode;
	public double beforRoundingValue = 0;
	public int pt_trn_no;
	public int index;
	
	public int getPt_trn_no() {
		return pt_trn_no;
	}

	public void setPt_trn_no(int pt_trn_no) {
		this.pt_trn_no = pt_trn_no;
	}

	public String getHostCode() {
		return HostCode;
	}

	public void setHostCode(String hostCode) {
		HostCode = hostCode;
	}

//	public int getEntryNo() {
//		return entryNo;
//	}
//
//	public void setEntryNo(int entryNo) {
//		this.entryNo = entryNo;
//	}
	
	public int getPt_id() {
		return pt_id;
	}
	public void setPt_id(int pt_id) {
		this.pt_id = pt_id;
	}
	public int getPt_store_id() {
		return pt_store_id;
	}
	public void setPt_store_id(int pt_store_id) {
		this.pt_store_id = pt_store_id;
	}
	public int getPt_station() {
		return pt_station;
	}
	public void setPt_station(int pt_station) {
		this.pt_station = pt_station;
	}
	public String getPt_date() {
		return pt_date;
	}
	public void setPt_date(String pt_date) {
		this.pt_date = pt_date;
	}
	public int getPt_seq_no() {
		return pt_seq_no;
	}
	public void setPt_seq_no(int pt_seq_no) {
		this.pt_seq_no = pt_seq_no;
	}
	public String getPt_online() {
		return pt_online;
	}
	public void setPt_online(String pt_online) {
		this.pt_online = pt_online;
	}
	public int getPt_function() {
		return pt_function;
	}
	public void setPt_function(int pt_function) {
		this.pt_function = pt_function;
	}
	public double getPt_due() {
		return pt_due;
	}
	public void setPt_due(double pt_due) {
		this.pt_due = pt_due;
	}
	public double getPt_tender() {
		return pt_tender;
	}
	public void setPt_tender(double pt_tender) {
		this.pt_tender = pt_tender;
	}
	public double getPt_change() {
		return pt_change;
	}
	public void setPt_change(double pt_change) {
		this.pt_change = pt_change;
	}
	public String getPt_ref_no() {
		return pt_ref_no;
	}
	public void setPt_ref_no(String pt_ref_no) {
		this.pt_ref_no = pt_ref_no;
	}
	public String getPt_auth_chk() {
		return pt_auth_chk;
	}
	public void setPt_auth_chk(String pt_auth_chk) {
		this.pt_auth_chk = pt_auth_chk;
	}
	public String getPt_card_type() {
		return pt_card_type;
	}
	public void setPt_card_type(String pt_card_type) {
		this.pt_card_type = pt_card_type;
	}
	public String getPt_card_no() {
		return pt_card_no;
	}
	public void setPt_card_no(String pt_card_no) {
		this.pt_card_no = pt_card_no;
	}
	public String getPt_Auth() {
		return pt_Auth;
	}
	public void setPt_Auth(String pt_Auth) {
		this.pt_Auth = pt_Auth;
	}
	
	public boolean isRoundup(){
		boolean check = false;
		
		if (afterRoundingValue > 0 && afterRoundingValue > beforRoundingValue) {
			check = true;
		}
		
		return check;
	}
	
	public PaymentType getPaymentType(int fid){
		
		return MoleQUtil.getPaymentbyId(fid);
	}


}
